package com.tsj.spzx.config;

import com.tsj.spzx.interceptor.UserLoginAuthInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class UserWebMvcConfiguration implements WebMvcConfigurer {

    @Autowired
    private UserLoginAuthInterceptor userLoginAuthInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(userLoginAuthInterceptor)
                .addPathPatterns("/api/**")
        .excludePathPatterns("/api/order/alipay/callback/notify")
        .excludePathPatterns("/api/order/orderInfo/auth/getOrderInfo/**")
        .excludePathPatterns("/api/order/orderInfo/auth/updateOrderInfoStatusPayed/**");
    }
}
